import request from '@/utils/request'

export default {
  tbTypeList(){
    return request({
      url: '/tb-type/tbTypeList',
      method: 'get',
    })
  },
  tbTypeDelete(params){
    return request({
      url: '/tb-type/tbTypeDelete',
      method: 'get',
      params
    })
  },
  tbTypeById(params){
    return request({
      url: '/tb-type/tbTypeById',
      method: 'get',
      params
    })
  },
  tbTypeUpdate(data){
    return request({
      url: '/tb-type/tbTypeUpdate',
      method: 'post',
      data
    })
  },
  tbTypeAdd(data){
    return request({
      url: '/tb-type/tbTypeAdd',
      method: 'post',
      data
    })
  },
  tbTypePage(params){
    return request({
      url: '/tb-type/tbTypePage',
      method: 'get',
      params
    })
  },

  tbDevice(params){
    return request({
      url: '/tb-device/tbDevice',
      method: 'get',
      params
    })
  },
  tbDeviceList(params){
    return request({
      url: '/tb-device/tbDeviceList',
      method: 'get',
      params
    })
  },
  tbDeviceDelete(params){
    return request({
      url: '/tb-device/tbDeviceDelete',
      method: 'get',
      params
    })
  },
  // tbDevicesAdd(data){
  //   return request({
  //     url: '/tb-device/tbDevicesAdd',
  //     method: 'post',
  //     data
  //   })
  // },
  tbDevicesAdd(params) {
    // console.log(params)
    return request({
      url: "/tb-device/tbDevicesAdd",
      method: "post",
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      // contentType: false,
      withCredentials:false,
      // processData: false,
      // dataType: "json",
      data: params,
    })
  },
  // tbDeviceUpdate(params) {
  //   // console.log(params)
  //   return request({
  //     url: "/tb-device/tbDeviceUpdate",
  //     method: "post",
  //     headers: {
  //       'Content-Type': 'multipart/form-data'
  //     },
  //     // contentType: false,
  //     withCredentials:false,
  //     // processData: false,
  //     // dataType: "json",
  //     data: params,
  //   })
  // },
  tbDeviceUpdate(params){
    return request({
      url: '/tb-device/tbDeviceUpdate',
      method: 'post',
      params
    })
  },
}
